

class MyCompositeDecorator < MyComposite

  def << composite
    raise 'already have child' if child
    super composite
  end

  def child= composite
    remove_children
    self << composite
  end

  def child
    @children[0]
  end

end